﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace wne
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            //wne.core.AdminFacadeSql 
            //wne.core.AdminFacadeSql af= new core.AdminFacadeSql();
            //af.AddUser_with_groups_with_fields();
           // af.RemoveGroup(2);
            //af.GetUserById(1017);
           /* var adfacade = new core.AdminFacadeSql();
            models.GroupModel g = adfacade.GetGroupById(1098);
            g.Id = 1098;
            g.Name = "www";
            //adfacade.RemoveGroup(1010);
            //Assert.AreEqual(adfacade.AddGroup("g2"),1010);
            //g.SelectedParents.Add(1010, "g2");
            wne.models.FieldModel fieldModel = new wne.models.FieldModel();
            fieldModel.FieldId = 0;
            fieldModel.Mandatory = false;
            fieldModel.Type = (wne.models.FieldTypeEnum)5;
            fieldModel.UserCanEdit = true;
            fieldModel.Name = "field1";
            fieldModel.AvaliableValues.Add(0, "qqq");
            fieldModel.AvaliableValues.Add(1, "qqw");
            fieldModel.AvaliableValues.Add(2, "qqe");

            g.Fields.Insert(0, fieldModel);
            adfacade.UpdateGroup(g);
            /*UserModel us = new UserModel();
            us.FirstName = "father";
            us.Phone = "666";
            us.SecondName = "son";
            us.UserBd = "01.01.1999";
            us.UserEmail = "@mail.ru";
            us.UserName = "Iegova";
            us.Surname = "sn_spirit";
            us.UserGroups = new List<GroupModel>();
            us.UserGroups.Add(g);
            us.Id = adfacade.AddUser(us);
            adfacade.RemoveUser((int)us.Id);*/
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            
            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );
            

        }
    }
}